package com.fengye.school.model.school;

import com.fengye.school.model.BaseEntity;
import com.fengye.school.model.school.enums.LessonType;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;
import java.util.Set;

/**
 * 教学单元
 */
@Table(name = "tb_s_lesson")
@org.hibernate.annotations.Table(appliesTo = "tb_s_lesson", comment = "教学单元表")
@Entity
@Getter
@Setter
public class Lesson extends BaseEntity {

    /**
     * 课程名称
     */
    @Column(name = "title", columnDefinition = "varchar(255) comment '课程名称'")
    private String title;

    /**
     * 教学类型
     */
    private LessonType lessonType;

    /*上课地点*/
    private String position;
    // @Column(name = "course_type", columnDefinition = "varchar(255) comment '课程类型'")
    // private CourseType courseType;

    /*上课时间*/
    private Date startTime;

    /* 下课时间 */
    private Date endTime;

    /**
     * 主讲老师
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "teacher_id", columnDefinition = "bigint comment '教师id'")
    private Teacher teacher;

    /**
     * 所属课程
     */
    // @ManyToOne(fetch = FetchType.LAZY)
    // @Column(name = "course_id")
    // private Course course;


    /**
     * 开设这门课程的专业/院系
     */
    // @ManyToOne
    // @JoinColumn(name = "major_id", columnDefinition = "bigint comment '专业名称'")
    // private Major major;

//    @ManyToMany(mappedBy = "courseSet", targetEntity = Student.class)
//    private Set<Student> studentSet;

}
